package sh.wn36.vehiclemanage.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.FeesManager;
import sh.wn36.vehiclemanage.mapper.FeesManagerMapper;
import sh.wn36.vehiclemanage.service.FeesManagerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import sh.wn36.vehiclemanage.xzh.FeeInfo;
import sh.wn36.vehiclemanage.xzh.FeeQuery;
import sh.wn36.vehiclemanage.xzh.RepairInfo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class FeesManagerServiceImpl extends ServiceImpl<FeesManagerMapper, FeesManager> implements FeesManagerService {
    @Autowired
    private FeesManagerMapper feesManagerMapper;

    @Override
    public IPage<FeeInfo> getListByCarNo(Page<RepairInfo> page, String text) {
        return feesManagerMapper.getListByCarNo(page,text);
    }

    @Override
    public IPage<FeeInfo> getListByUnitName(Page<RepairInfo> page, String text) {
        return feesManagerMapper.getListByUnitName(page,text);
    }

    @Override
    public IPage<FeeInfo> getListByRname(Page<RepairInfo> page, String text) {
        return feesManagerMapper.getListByRname(page,text);
    }

    @Override
    public IPage<FeeInfo> getList(Page<RepairInfo> page) {
        return feesManagerMapper.getList(page);
    }

    @Override
    public FeeInfo getDetailById(Integer id) {
        return feesManagerMapper.getDetailById(id);
    }

    @Override
    public int updateFees(Integer id,FeesManager feesManager) {
        return feesManagerMapper.updateFees(id,feesManager.getCarId(),feesManager.getFeesName(),feesManager.getFeesDate(),feesManager.getFeesAmount(),feesManager.getFeesUnit(),feesManager.getOperator(),feesManager.getRemarks());
    }

    @Override
    public List<Map<String, Object>> getTable() {
        return feesManagerMapper.getTable();
    }

    @Override
    public List<Map<String, Object>> getTableByCarId(Integer id) {
        return feesManagerMapper.getTableByCarId(id);
    }
}
